package com.shierke.Ume.ui.adapter.me

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.shierke.Ume.R
import kotlinx.android.synthetic.main.item_who_like_me.view.*

/**
 * Create by Ybx
 * on 2020-10-20
 * Desribe:
 */
class LikeMeAdapter : RecyclerView.Adapter<LikeMeAdapter.ViewHolder>() {


    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {


        val view =
            LayoutInflater.from(parent.context).inflate(R.layout.item_who_like_me, null, false)
        return ViewHolder(view)

    }

    override fun getItemCount() = 15

    override fun onBindViewHolder(holder: ViewHolder, position: Int) {
        holder.onBind(position)
    }


    class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
        fun onBind(position: Int) {

            with(itemView){

                if (position  % 2 == 0){
                    realTimeView.visibility = View.GONE
                }else{
                    realTimeView.visibility = View.VISIBLE
                }

            }



        }


    }
}